import React from 'react'
// 加载Component
import { Component, PureComponent } from 'react'
//全局配置
import Config from '../../config/config'
// 选项卡、表格、弹出确认框

import ReactEcharts from 'echarts-for-react';

export default class extends Component {
    constructor(props){
        super(props);
        this.state={
            option:{}
        };
        
    }
    getOption(){
        let option={...this.props.Option}

        return option
    }
    onChartClick(param,echarts){
    }
    onChartLegendselectchanged(param,echarts){
    }

    componentWillReceiveProps (nextprops) {
        if (nextprops.Option != this.state.option ) {
            let option=nextprops.Option
            this.refs.chart.getEchartsInstance().setOption(option)
        }
      }
    componentWillMount(){
    }
    componentDidMount(){
    }
    render(){
        return(
            <div className="echartsRadar">
                <ReactEcharts
                    ref='chart'
                    option={this.getOption()}
                    notMerge={true}
                    lazyUpdate={false}
                    style={{width: '1200px',height:'700px'}}
                />
            </div>
        )
    }
}